<template>
	<el-form ref="ruleFormRef" :model="formInline" :rules="formRules" label-width="auto" v-loading="isLoading">
		<el-row :gutter="30">

			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.id' prop='id'>
					<el-input v-model.trim='formInline.id' clearable :placeholder='prompt?.id' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.projectName' prop='projectName'>
					<el-input v-model.trim='formInline.projectName' clearable :placeholder='prompt?.projectName' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.missionName' prop='missionName'>
					<el-input v-model.trim='formInline.missionName' clearable :placeholder='prompt?.missionName' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.missionStatus' prop='missionStatus'>
					<el-input v-model.trim='formInline.missionStatus' clearable
						:placeholder='prompt?.missionStatus' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.cycleValue' prop='cycleValue'>
					<el-input v-model.trim='formInline.cycleValue' clearable :placeholder='prompt?.cycleValue' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.finishDate' prop='finishDate'>
					<el-input v-model.trim='formInline.finishDate' clearable :placeholder='prompt?.finishDate' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.inspectResult' prop='inspectResult '>
					<el-input v-model.trim='formInline.inspectResult' clearable
						:placeholder='prompt?.inspectResult' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.inspectUser' prop='inspectUser'>
					<el-input v-model.trim='formInline.inspectUser' clearable :placeholder='prompt?.inspectUser' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.dealCount' prop='dealCount'>
					<el-input v-model.trim='formInline.dealCount' clearable :placeholder='prompt?.dealCount' />
				</el-form-item>
			</re-col> </el-row>
	</el-form>
</template>

<script setup lang="ts">
import { ref, reactive } from "vue";
import ReCol from "@/components/ReCol";
import type { FormRules } from "element-plus";
import { titles, prompt } from './index';
import type { infoType } from '@/api/Inspection-tasks/index';
type FormProps = {
	formInline: infoType,
	isLoading: boolean
}

const props = withDefaults(defineProps<FormProps>(), {
	formInline: () => ({} as infoType),
	isLoading: false
});

const formRules = reactive(<FormRules>{
	id: [{ required: true, message: prompt?.id, trigger: 'blur' },],
	projectName: [{ required: true, message: prompt?.projectName, trigger: 'blur' },],
	missionName: [{ required: true, message: prompt?.missionName, trigger: 'blur' },],
	missionStatus: [{ required: true, message: prompt?.missionStatus, trigger: 'blur' },],
	cycleValue: [{ required: true, message: prompt?.cycleValue, trigger: 'blur' },],
	finishDate: [{ required: true, message: prompt?.finishDate, trigger: 'blur' },],
	inspectResult: [{ required: true, message: prompt?.inspectResult, trigger: 'blur' },],
	inspectUser: [{ required: true, message: prompt?.inspectUser, trigger: 'blur' },],
	dealCount: [{ required: true, message: prompt?.dealCount, trigger: 'blur' },],
});
const ruleFormRef = ref();
//    const newFormInline = ref(props.formInline as any);
//
//
//    watch(()=>props.formInline,()=>{
//    	newFormInline.value = props.formInline
//    },{
//    	deep:true,
//    	immediate:true
//    })
function getRef() {
	return ruleFormRef.value;
}

defineExpose({ getRef });
</script>
